/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PulseTest.java
 *
 * Created on Dec 1, 2009, 7:33:29 PM
 */
package SwingAnimation;

import GUIUtilities.LabelManager;
import java.awt.Dimension;

/**
 *
 * @author Heather
 */
public class PulseTest extends javax.swing.JApplet
{

  /** Initializes the applet PulseTest */
  public void init()
  {
    try
    {
      java.awt.EventQueue.invokeAndWait(new Runnable()
      {

        public void run()
        {
          initComponents();
          container.setLayout(null);
          win.setLocation(15, 15);
          lose.setLocation(15, 15);
          noConflict.setLocation(15, 15);
          winCP = new ColorPulser(win, ColorPulser.PulseOptions.lighten);
          loseCP = new ColorPulser(lose, ColorPulser.PulseOptions.darken);
          noConflictP = new ColorPulser(noConflict, ColorPulser.PulseOptions.lighten);
          cp2 = new ColorPulser(toPulse2, ColorPulser.PulseOptions.darken);
          cp = new ColorPulser(toPulse1);

          //container.add(lose);
          //container.add(win);
          container.add(noConflict);
          noConflictP.setToMediumPhasing();
          noConflictP.startAnimation();
          winCP.setToSlowPhasing();
          winCP.startAnimation();
          /*
          a.setSize(d);
          a.setPreferredSize(d);
          container.add(a);
          arrowP = new ColorPulser(a);
          arrowP.startAnimation();
           */

          cp.setToReallyFastBlinking();
          cp.startAnimation();
          
          cp2.setToSlowPhasing();
          cp2.startAnimation();
          

        //winCP.startAnimation();
        //loseCP.startAnimation();
        }
      });
    } catch (Exception ex)
    {
      ex.printStackTrace();
    }
  }

  /** This method is called from within the init() method to
   * initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is
   * always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    toPulse1 = new javax.swing.JButton();
    toPulse2 = new javax.swing.JButton();
    container = new javax.swing.JPanel();

    toPulse1.setBackground(new java.awt.Color(255, 0, 0));
    toPulse1.setText("PULSE");

    toPulse2.setBackground(new java.awt.Color(255, 51, 51));
    toPulse2.setText("PULSE");
    toPulse2.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        toPulse2ActionPerformed(evt);
      }
    });

    container.setBackground(new java.awt.Color(255, 255, 255));

    javax.swing.GroupLayout containerLayout = new javax.swing.GroupLayout(container);
    container.setLayout(containerLayout);
    containerLayout.setHorizontalGroup(
      containerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 252, Short.MAX_VALUE)
    );
    containerLayout.setVerticalGroup(
      containerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 185, Short.MAX_VALUE)
    );

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
          .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(container, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
          .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
            .addGap(18, 18, 18)
            .addComponent(toPulse1, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addComponent(toPulse2, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)))
        .addContainerGap(138, Short.MAX_VALUE))
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
        .addContainerGap()
        .addComponent(container, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        .addGap(18, 18, 18)
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
          .addComponent(toPulse2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(toPulse1, javax.swing.GroupLayout.DEFAULT_SIZE, 75, Short.MAX_VALUE))
        .addContainerGap())
    );
  }// </editor-fold>//GEN-END:initComponents

    private void toPulse2ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_toPulse2ActionPerformed
    {//GEN-HEADEREND:event_toPulse2ActionPerformed
      // TODO add your handling code here:
    }//GEN-LAST:event_toPulse2ActionPerformed
  // Variables declaration - do not modify//GEN-BEGIN:variables
  private javax.swing.JPanel container;
  private javax.swing.JButton toPulse1;
  private javax.swing.JButton toPulse2;
  // End of variables declaration//GEN-END:variables
  ColorPulser cp;
  ColorPulser cp2;
  ColorPulser winCP;
  ColorPulser loseCP;
  ColorPulser arrowP;
  ColorPulser noConflictP;
  Dimension d = new Dimension(252, 185);
  ArrowComponent a = new ArrowComponent();
  CCPVConflictOutcomeLabel win = new CCPVConflictOutcomeLabel(true);
  CCPVConflictOutcomeLabel lose = new CCPVConflictOutcomeLabel(false);
  CCPVNoConflictLabel noConflict = new CCPVNoConflictLabel();
}
